Skip to main content

Full text of "4ComLab1"

See other formats


■* ii 



FortCi) CoDfffDDfffDdaDfDBenfiBoiro^ 



labl_organization 



Sec (1) 

1- Asmaa Abdelmonem Eyssa 

2- Asmaa Mohamed Kamal 

3- Asmaa Shaban Mahmoud 

4- Basma Gamal 



i * 



ir= 



=T1 



PART 1-MASKABLE INTERRUPTS: 



File Edit Tools Options 



OOOl 
0002 
0003 
0004 
0005 
0006 
0007 
OOOS 
0009 
0010 
0011 
0012 
0013 
0014 
0015 



[ JP 500 
INT 
.ORG 
EXX 
LD D, 
LD C, 
OUT ( 
CALL 
LD D, 
OUT ( 
EXX 
RETI 

HA IN 
. ORG 
IH 1 



OH 

ISR 

003SH 

055H 
03H 

C) , D 

WAIT 
OOH 

C) , D 



PROG. 
5000H 



Lin 1 , Col 



Nunn of lines: 29 



0027 
002S 
0029 
0030 
0031 



0027 5016 20 FD 

002S 501S 10 F9 

0029 501A C9 

Nuiriber of errors = 



JR NZ, LP2 
DJNZ LP1 
RET 



.in 31 , Col 



Nunn of lines: 31 




File Simulation Rate Tools Options Help 

Program location E : \D esk T op 2\N e wVasssssssssssssssssssssssma'^AS M AA 
- Main registers - 

a~ rw 



01 
02 
40 
FF 
FF 
FF 



_§_ IFF_ | Next f 



■ Alternate registers -■ 




A' 
B' 
C 
D' 
E' 
H' 

Tnl 


FF 
FF 
FF 
FF 
FF 
FF 
FF J 









JR NZ,t-01H 



DEC A 

| Clock cycles counter I 13073 
Instructions counter 



' Device1 rl/Op«t02H— 

on 1 1 r in <? out CXXQCCQO rsoH- 



l Device2 rl/Op«t03H— 

on 1 1 r in (t out QCCOCCOO row" 



Device 3l 



pl/U port 

nHp out occoccoo rooTr 



' Device4 rl/O port— 

0FF 1 1 r in p out (XXXXXQO r°QH~ 




Is 



a-i 



ir= 



=T1 



11-Comment of the out on port 02: the out is the rotate right of content 
of the register D it represented by led. 

If the light is on (represent logic (1)), if the light is off (represent logic 
(0)). 




If 

M 


Program 

ain regi 

~A~ 
B 
C 
D 


location 

sters 

09 
01 
03 
55 

5L 



12-if click on putton (INT) 

*the out on port 02 is pause (the led not rotate at min time 

the out is 80H or 40H or 20H or 10H or 08H or 04H or 02H or 01H 

*the out on port 03 is 55H and after min time the out is 00H 

13- The content of pc register: before click on (INT) the content is the 
addresses of Instructions of the main program . 

after click on (INT) the content of pc is the address of the first 
instruction of interrupt program and pc content is increment by 1 
(pc=pc+l) note that (the address of the next instruction in the main 
program is saved in the stack) after finished from executing the 
interrupt program the content of pc is the next address of the next 
instruction of the main program. 



Is 



a-i 



ir= 



=T1 




15-to become (INT) enable: we should excute the main programe at first 

and the pc =5000H 

by click on the reset putton the main programe excute and the (INT)is 
enable 

PART 2. NON-MASKABLE INTERRUPTS: 







J,' H [f 1* 


File Edit Tools Options 




OOOl [ JP SOOOH 






0002 


; irJT ISR 






0003 


. ORG OOS6H 






0004 


EXX 






0005 


LD D, OS5H 






ooo e 


LD C , 03 H 






0007 


OUT (C) , D 






0008 


CALL WAIT 






0009 


LD D, OOH 






oo 10 


OUT (C) , D 






OOll 


EXX 






OO 12 


RETM 






0013 


; MAIN PROG. 






OO 1*1 


. ORG- SOOOH 






0015 


IH 1 






Lin 1 , Col 




Nurn of lines: 29J 


O O 2 "7 


0027 5016 20 FD 


JR NZ, LP2 




002S 


002S SOIS lO F9 


DJNZ LP1 




0029 


0029 SOIA C9 


RET 




0030 


WuLmloer: o£ errors = O 






003 1 








Lin 31 , Col 




Nurn of lines: 3~l| 



Is 



a-i 



ir= 



=T1 



II 




E:\DeskTop 2\N ew\asssssssssssssssssssssssma V^S M AA 
r Alternate registers 




l Device1 rl/Opot t 02H— 

| r in p out OQOOOCCO rrpH 



l Device2 rl/Op«t03H— 

on 1 1 r in p out QQQQQCCO Hbh 



rl/u port 

off 1 1 r in p out (ixxaixxx) n^ 



f in pout coooocco noFT 



] 

— L 




File Simulation Rate Tools Options Help 
Program location E : \D esk T op 2\N ew'xasss sss sssssssssssssssssrna \A,S M AA 

Last instruction 



M 


ain reg 

"a~ 

B 
C 
D 
E 
H 

"Til 


isters 

rw 
rw 
rw 
r~FF~ 
rTF~ 


A 


ternate 

"a 1- 

B' 
C 
D' 
E' 
H' 

T*1l 


registers - 

roo~ 
roo~ 

l~FF~ 
l~FF~ 
1 FF 



Main F register 



SF nr 

zf nr 

yf rr 

hf nr 

xf rr 

pf nr 

NF it 

CF ITT 



Alternate F register 



f 

F 

f 

F 
F 
F 
F 
F 



r 



JR NZ,t-01H 



| Next | DEC A 

| Clock cycles counter I 39159 



| Instructions counter 4754 
r 1 6-bit registers — 


n>rr 
rrri 






FFFF 


| SP I FFFD 
| PC I 5015 


FFFF 






Special registi 
Interrupt control - 

Pfft rr [?f7 rr 

NMI I |NT 



RE-SET" | 



Device 1 1I 



rl/u port uzm 

| r in p out QQQQQCCO HST 



Device 2| 



rl/u port UJH 

1 1 r in t? out QQQQQCCO H^ 



rl/u port 

off 1 1 r in ff out QQQQQCCO HcfT 



Device 4 



I/O port 



rl/u port 

off 1 1 r in p out OQCOCCCO fra" 



Output Terminal 



I/O port 
OFF I Clear 



I~ Always On Top 




Is 



a* 



ir= 



=T1 



1-The out on port 03 is 55H at min time and the (NMI) Is disable 

(INT) was disabled when (NMI) occurred this not allow the any interrupt 
to execute so the (INT) Is disable, after finished from non maskable 
interrupt RETN instruction allow interrupt to be enable 

When Remove the RETN instruction 





^^-jewHrL^i^^I^^g^ 








File Edit Tools Options 










OOOl | JF SOOOH 








— ■ 


0002 


; INT ISR. 










0003 


.ORG OOSSH 










OOO -*! 


E3C3C 










OOOS 


LD ZJ , OSSH 










ooo e 


LD C , 03 H 










000~7 


OUT (C) , ZJ 










ooos 


CJ^LL TVTJ^IT 










ooos 


LZJ ZJ , OOH 










oo 10 


out (C) , D 










OO 1 1 


e^:^: 










OO 12 


; MAIM FROG- 










OO 13 


. ORG SOOOH 










OO 1^1 


IM 1 










OO IS 


E I 








— 


Lin 11,C 


ol 4 




Nljiti of lines 


2S 


002 e loose sois so 


FD 


JR. NZ, LPS 




^J 


002~7 OOS-7 SOIS lO 


E9 


DJNZ LF1 




^ 


OOSS 0028 SOU*. C9 




RET 




■J 


002S Wuiritier <=. :£ enters = O 






1 


003 O 1 








H 


Lin 30_ Col O 




Nljiti of lines 


3o| 




CX30COOCO rooH- 




CX3QCOOCO rooH- 



axxxxxx) i 





| Output Terminal 




1 


1 I/O port 

OFF | Clear | 








HI 




| Always On Top 





Is 



a-i 



2-if remove RETN from the programe and click on (NMI) 
the (INT)and(NMI)are disable and then the program stop . 
RETN it allow the interrupt to be excuted (enable) . 



i K